#include <cstdio>
#include <cmath>
#include <iostream>

using namespace std;

int poj1003(float);

int main()
{
	double data[300];
	double cards[1000];
	data[0] = 0.5;
	int last = 0;
	int i =0 ; 
	while(cin>>cards[i]) i++;

	int j=0;
	for(;j<i-1;j++)
	{
		double length = cards[j];
		if(abs(length - 0.00) < 0.001)
			break;
		while(length > data[last])
		{
			last++;
			data[last] = 1.0 / (last + 2) + data[last - 1];
		}

		int i = last;
		while(data[i] >= length) i--;
		if(data[i] < length) 
		{
		/*
			cout<<"#"<<length<<endl;
			if(i + 2 != poj1003(length))
				cout<<"error "<<length<<endl;
			*/
			printf("%d card(s)\n", i + 2);
		}
		
		//length += 0.01;
	}

	return 0;
}

int poj1003(float cards)
{
	float number=0.00;
	int i=0;
	int j=0;
	

	while(number<cards)
	{		
		j++;
		number+=(float)1/(1+j);
	}
	
	return j;
}
